package com.itheima.treesetdemo;

import java.util.Set;
import java.util.TreeSet;

public class MyTreeSet2 {
    public static void main(String[] args) {
        Set <Student> set = new TreeSet<>();
        set.add(new Student("zhangsan",23));
        set.add(new Student("lisi",23));
        set.add(new Student("wangwu",25));

        for (Student student : set) {
            System.out.println(student);
        }
    }
}
